<?php
namespace yan\jwt\factory;
use Yii;
use ExpiredException;
use yan\jwt\jwt\Key;
class JwtToken extends \yan\jwt\AbstractFactory{
    public $environment;
    private $jwt;
    function build($environment)
    {
        $this->environment = $environment;
        $this->jwt = \yan\jwt\jwt\Jwt::instance();
        $this->init();
        return $this;
    }
    public function init(){
        
    }
    public function run($data){
        return $this->jwt->encode($data['payload'], $data['head'], $this->environment->getPrivateKey());
    }	
}